package com.oet.persistence.entity;

// Generated Feb 6, 2010 3:22:38 PM by Hibernate Tools 3.2.4.GA

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * YdkAccount generated by hbm2java
 */
@Entity
@Table(name = "user_history_course", catalog = "oet")
public class UserHistoryCourse implements java.io.Serializable {

	private Long id;
	private Long courseId;
	private Long courseSeriesId;
	private Integer chapterId;
	private String name;
	private Integer type;
	private Integer level;
	private Double payFactor;
	private Long teacherId;
	private String teacherName;
	private String topic;
	private String description;
	private Integer capacity;
//	private Integer occupyNum;
	
	private Date date;
	private Double durationFactor;
	private Date lastModified;
	private Integer courseScore;
	private Integer teacherScore;
	private Boolean isCommented;
//	private Double score;
//	private Integer scoredNumber;
	
	private Customer customer;

	public UserHistoryCourse() {
	}
	
	


	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	
	@Column(name = "course_id")
	public Long getCourseId() {
		return courseId;
	}
	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}

	@Column(name = "course_series_id")
	public Long getCourseSeriesId() {
		return courseSeriesId;
	}
	public void setCourseSeriesId(Long courseSeriesId) {
		this.courseSeriesId = courseSeriesId;
	}




	@Column(name = "chapter_id")
	public Integer getChapterId() {
		return chapterId;
	}
	public void setChapterId(Integer chapterId) {
		this.chapterId = chapterId;
	}
	
	
	@Column(name = "name", nullable = false, length = 250)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	

	@Column(name = "level")
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}

	

	@Column(name = "description")
	@Lob
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	
	@Column(name = "capacity")
	public Integer getCapacity() {
		return capacity;
	}
	public void setCapacity(Integer capacity) {
		this.capacity = capacity;
	}
	
//	@Column(name = "occupy_num")
//	public Integer getOccupyNum() {
//		return occupyNum;
//	}
//	public void setOccupyNum(Integer occupyNum) {
//		this.occupyNum = occupyNum;
//	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "date")
	public Date getDate() {
		return date;
	}
	public void setDate(Date date) {
		this.date = date;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_modified")
	public Date getLastModified() {
		return lastModified;
	}
	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}

//	@Column(name = "score")
//	public Double getScore() {
//		return score;
//	}
//	public void setScore(Double score) {
//		this.score = score;
//	}
//
//	@Column(name = "scored_number")
//	public Integer getScoredNumber() {
//		return scoredNumber;
//	}
//	public void setScoredNumber(Integer scoredNumber) {
//		this.scoredNumber = scoredNumber;
//	}
	
	@Column(name = "course_score")
	public Integer getCourseScore() {
		return courseScore;
	}
	public void setCourseScore(Integer courseScore) {
		this.courseScore = courseScore;
	}



	@Column(name = "teacher_score")
	public Integer getTeacherScore() {
		return teacherScore;
	}
	public void setTeacherScore(Integer teacherScore) {
		this.teacherScore = teacherScore;
	}
	
	

	@Column(name = "type")
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "pay_factor")
	public Double getPayFactor() {
		return payFactor;
	}
	public void setPayFactor(Double payFactor) {
		this.payFactor = payFactor;
	}


	@Column(name = "teacher_id")
	public Long getTeacherId() {
		return teacherId;
	}
	public void setTeacherId(Long teacherId) {
		this.teacherId = teacherId;
	}

	@Column(name = "topic")
	public String getTopic() {
		return topic;
	}
	public void setTopic(String topic) {
		this.topic = topic;
	}

	@Column(name = "duration_factor")
	public Double getDurationFactor() {
		return durationFactor;
	}
	public void setDurationFactor(Double durationFactor) {
		this.durationFactor = durationFactor;
	}

	
	@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
	@JoinTable(
            name="customer_user_planned_course",
            joinColumns = @JoinColumn( name="user_planned_course_pk"),
            inverseJoinColumns = @JoinColumn( name="customer_pk")
    )
    public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}


	@Column(name = "is_commented")
	public Boolean getIsCommented() {
		return isCommented;
	}
	public void setIsCommented(Boolean isCommented) {
		this.isCommented = isCommented;
	}
	
	@Column(name = "teacher_name")
	public String getTeacherName() {
		return teacherName;
	}
	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}
	

}
